package main

import (
	"fmt"
	"runtime"
	"strconv"
	"time"
)

func test1() int {
	for i := 1; i <= 10; i++ {
		fmt.Println("test:hello" + strconv.Itoa(i))
		time.Sleep(2 * time.Second)
	}
	return 1
}

func main() {
	go test1()
	for i := 1; i <= 5; i++ {
		fmt.Println("main:hello" + strconv.Itoa(i))
		time.Sleep(time.Second)
	}
	fmt.Println("电脑cpu数量:", runtime.NumCPU())
	//runtime.GOMAXPROCS(runtime.NumCPU()),现在的版本不用自己设置核心数了，默认就是最大核心数
}
